package com.sky.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.io.Serializable;

@Data
public class EmployeeDTO implements Serializable {

    private Long id;

    @NotBlank(message = "用户名不能为空")
    @Size(min = 3, max = 20, message = "用户名长度必须在3到20个字符之间")
    @ApiModelProperty("用户名")
    private String username;

    @NotBlank(message = "姓名不能为空")
    @Size(min = 3, max = 20, message = "姓名长度必须在3到20个字符之间")
    @ApiModelProperty("姓名")
    private String name;

    @Pattern(regexp = "^\\d{10,11}$", message = "手机号格式不正确")
    @ApiModelProperty("手机号")
    private String phone;

    @Pattern(regexp = "^(男|女|其他)$", message = "性别应为'男'、'女'或'其他'")
    @ApiModelProperty("性别")
    private String sex;

    @Pattern(regexp = "^\\d{15,18}$", message = "身份证号格式不正确")
    @ApiModelProperty("身份证号")
    private String idNumber;

}
